package com.rock.code.system.login.service;

import com.rock.code.base.domain.AjaxJson;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.ByteArrayOutputStream;
import java.util.Map;

/**
 * The interface Login service.
 *
 * @author kongqiang
 * @date 2017.03.30
 */
public interface LoginService {

    /**
     * Go login page.
     *
     * @param request the request
     * @author kongqiang
     * @date 2017.03.30
     */
    void goLoginPage(HttpServletRequest request);

    /**
     * User login.
     *
     * @param request  the request
     * @param response the response
     * @param param    the param
     * @return the ajax json
     * @throws Exception the exception
     * @author kongqiang
     * @date 2017.03.30
     */
    AjaxJson userLogin(HttpServletRequest request, HttpServletResponse response, Map<String, Object> param) throws Exception;

    /**
     * Generate captcha.
     *
     * @param request the request
     * @param output  the output
     * @author kongqiang
     * @date 2017.03.30
     */
    void generateCaptcha(HttpServletRequest request, ByteArrayOutputStream output);
}
